// components/index/collect/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    collect: {
      type: Boolean,
      observer: function() {
      }
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    yesSrc: "/images/banner/icon_collect_sel.png",
    noSrc: "/images/banner/icon_collect_nor.png",
    yesText: '已收藏',
    noText: '收藏',
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onCollect: function(event) {
      let collect = this.properties.collect
      this.triggerEvent('onCollect',{
        isCollect: !collect
      },{})
    }
  }
})
